The creation is async, and the sidebar could be destroyed while the D-Bus proxy is being created.
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
sidebar->hostnamed_proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
g_clear_object (&sidebar->hostnamed_cancellable);
+ g_object_unref (sidebar);
+
if (error != NULL) {
g_debug ("Failed to create D-Bus proxy: %s", error->message);
g_error_free (error);
"org.freedesktop.hostname1",
sidebar->hostnamed_cancellable,
hostname_proxy_new_cb,
- sidebar);
+ g_object_ref (sidebar));
}
static void